//
//  UIScrollView+ScrollRefresh.m
//  Randomdoor
//
//  Created by ff on 2022/8/11.
//

#import "UIScrollView+ScrollRefresh.h"

@implementation UIScrollView (ScrollRefresh)

- (void)headerRefreshBlock:(void (^)(void))block
{
    MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
        if (block) block();
    }];
    header.backgroundColor = UIColor.clearColor;
//    header.lastUpdatedTimeLabel.hidden = YES;
//    header.stateLabel.hidden = YES;
    header.arrowView.image = nil;
    self.mj_header = header;

    
}

- (void)footerRefreshBlock:(void (^)(void))block
{
    MJRefreshAutoNormalFooter *footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
        if (block) block();
    }];
    footer.refreshingTitleHidden = YES;
    footer.stateLabel.hidden = YES;
    self.mj_footer = footer;
}

@end
